package com.neulogistics.contrib.procuredcenter.api.application.command;

import com.blackto.lib.mediat.unicast.IRequest;
import com.neulogistics.contrib.procuredcenter.api.application.validator.annotation.ValidateAddress;
import com.neulogistics.contrib.procuredcenter.domain.model.valueobject.Address;
import com.neulogistics.infrastructure.common.serviceresult.BaseResponse;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;

@Data
public class CreateVendorCommand implements IRequest<BaseResponse<String>>, Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 供应商名称
     */
    @NotBlank
    @Size(max = 50)
    public String vendorName;

    /**
     * 地址{省，市，区，详细}
     */
    @NotNull
    @ValidateAddress
    public Address vendorAddress;

    /**
     * 联系人
     */
    @NotBlank
    @Size(max = 10)
    public String vendorContact;

    /**
     * 联系电话
     */
    @NotBlank(message = "客户电话号不能为空！")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "错误的手机号！")
    public String vendorPhone;

    /**
     * 开户行
     */
    @NotBlank
    @Size(max = 50)
    public String vendorAccountBank;

    /**
     * 银行账号
     */
    @NotBlank
    @Size(max = 20)
    public String vendorAccount;

    /**
     * 邮件地址
     */
    @NotBlank
    @Email
    public String vendorEmail;

    /**
     * 邮编
     */
    @NotBlank
    @Size(max = 6)
    public String vendorZip;

    /**
     * 法人
     */
    @NotBlank
    @Size(max = 50)
    public String vendorLegalPerson;

    /**
     * 备注
     */
    @Size(max = 200)
    public String vendorRemark;

}
